{
  "displayName":    "CodeHunt",       
  "name":           "codehunt",
  "mimeTypes":      ["text/codehunt"],
  "fileExtensions": ["ch"],
  
  
  "lineComment":      "// ",   
  "blockCommentStart": "/*",
  "blockCommentEnd":   "*/",
  
  "editorOptions": { "tabSize": 2, "insertSpaces": true },


  "keywords": [
    "extern", "alias", "using", "bool", "decimal", "sbyte", "byte", "short", 
    "ushort", "int", "uint", "long", "ulong", "char", "float", "double", 
    "object", "dynamic", "string", "assembly", "module", "is", "as", "ref", 
    "out", "this", "base", "new", "typeof", "void", "checked", "unchecked", 
    "default", "delegate", "var", "const", "if", "else", "switch", "case", 
    "while", "do", "for", "foreach", "in", "break", "continue", "goto", 
    "return", "throw", "try", "catch", "finally", "lock", "yield", "from", 
    "let", "where", "join", "on", "equals", "into", "orderby", "ascending", 
    "descending", "select", "group", "by", "namespace", "partial", "class", 
    "field", "event", "method", "param", "property", "public", "protected", 
    "internal", "private", "abstract", "sealed", "static", "struct", "readonly", 
    "volatile", "virtual", "override", "params", "get", "set", "add", "remove", 
    "operator", "true", "false", "implicit", "explicit", "interface", "enum",
    "null",
    "=",":"
  ],
  
  "directives": [
        "zone", "zoneInfoUrl", "zoneLogoSplashUrl", 
        "zoneLogoMenuUrl", "zoneNoHints", "zoneRequireUserId", 
        "zoneOffsetRating", "zoneStartTime", "zoneEndTime", 
        "sector", "sectorScoreWeight", 
        "level", "code", "secret"
  ],
  
  "extraKeywords": ["final","boolean","extends"],

  "typeKeywords": [
    "bool", "byte", "char", "decimal", "double", "fixed", "float", 
    "int", "long","object","sbyte","short","string","uint","ulong",
    "ushort","void"
  ],
  
  "extraTypeKeywords": [],
  
  "keywordInType": [
    "struct","new","where","class"
  ],
  
  "typeFollows": [
    "as", "class", "interface", "struct", "enum", "new","where", 
    ":"
  ],

  "namespaceFollows": [
    "namespace", "using"    
  ],
  
  "operators": [        
    "??", "||", "&&", "|", "^", "&", "==", "!=", "<=", ">=", "<<", 
    "+", "-", "*", "/", "%", "!", "~", "++", "--","+=", 
    "-=", "*=", "/=", "%=", "&=", "|=", "^=", "<<=", ">>=", ">>", "=>"
  ],
  
  "extraOperators": [],

  "symbols":  "[=><!~?:&|+\\-*\\/\\^%]+",
  
  
  "escapes": "\\\\(?:[abfnrtv\\\\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})",
  
  
  "tokenizer": {
    "root": [
      ["(#)(\\w+)(.*)", { "cases": {
                "$2@directives": ["namespace","namespace","string"],
                "@default": ["meta","meta","meta"]
      }}],

      ["[A-Z][\\w]*(?=[\\.\\w]*(\\s|\\/\\*!\\*\\/)+\\w)", "type.identifier" ],
      
      
      
      ["([A-Z][\\w]*[\\.\\w]*)(<)(?![^>]+>\\s*(?:\\(|$))", ["type.identifier", { "token": "@brackets", "next": "@type" } ]],
      ["([A-Z][\\w]*[\\.\\w]*)(<)", ["identifier", { "token": "@brackets", "next": "@type" } ]],
      
      
      
      
      ["[A-Z][\\w]*(?=\\.[A-Z])", "type.identifier" ],  
      ["[A-Z][\\w]*(?=\\.[a-z_])", "type.identifier", "@qualified" ],  
      
      
      ["[a-zA-Z_]\\w*", { "cases": {"@typeFollows": { "token": "keyword", "next": "@type" },
                                 "@namespaceFollows": { "token": "keyword", "next": "@namespace" }, 
                                 "@typeKeywords": { "token": "type.identifier", "next": "@qualified" },
                                 "@extraTypeKeywords": { "token": "type.identifier", "next": "@qualified" },
                                 "@keywords": { "token": "keyword", "next": "@qualified" },
                                 "@extraKeywords": { "token": "keyword", "next": "@qualified" },
                                 "@default": { "token": "identifier", "next": "@qualified" } } }],
      
      
      { "include": "@whitespace" },
      
      
      ["[{}()\\[\\]]", "@brackets"],
      ["[<>](?!@symbols)", "@brackets"],
      ["@symbols", { "cases": { "@operators": "operator", 
                              "@extraOperators": "operator", 
                              "@default"  : "" } } ],

      
      ["@\"", { "token": "string.quote", "bracket": "@open", "next": "@litstring" } ],

      
      ["\\d*\\.\\d+([eE][\\-+]?\\d+)?", "number.float"],
      ["0[xX][0-9a-fA-F]+", "number.hex"],
      ["\\d+", "number"],

      
      ["[;,.]", "delimiter"],
      
      
      ["\"([^\"\\\\]|\\\\.)*$", "string.invalid" ],  
      ["\"",  { "token": "string.quote", "bracket": "@open", "next": "@string" } ],
      
      
      ["'[^\\\\']'", "string"],
      ["(')(@escapes)(')", ["string","string.escape","string"]],
      ["'", "string.invalid"]
    ],
    
    "qualified": [
      ["[a-zA-Z_][\\w]*", { "cases": { "@typeFollows": { "token": "keyword", "next": "@type" }, 
                                    "@typeKeywords": "type.identifier",
                                    "@keywords": "keyword",
                                    "@default": "identifier" } }],
      ["\\.", "delimiter"],
      ["","","@pop"]            
    ],
    
    "type": [
      { "include": "@whitespace" },      
      ["[A-Z]\\w*", "type.identifier"],
      
      ["[a-zA-Z_]\\w*", { "cases": {"@typeKeywords": "type.identifier",
                                 "@keywordInType": "keyword",
                                 "@keywords": {"token": "@rematch", "next": "@popall"},
                                 "@default": "type.identifier" } }],
      ["[<]", "@brackets", "@type_nested" ],
      ["[>]", "@brackets", "@pop" ],
      ["[\\.,:]", { "cases": { "@keywords": "keyword",
                            "@default": "delimiter" }}],
      ["","","@popall"] 
    ],
    
    "type_nested": [
      ["[<]", "@brackets", "@type_nested" ],
      { "include": "type" }
    ],

    "namespace": [
      { "include": "@whitespace" },
      ["[A-Z]\\w*", "namespace"],
      ["[\\.=]", "keyword"],
      ["","","@pop"]
    ],

    "comment": [
      ["[^\\/*]+", "comment" ],
      
      ["\\*/",    "comment", "@pop"  ],
      ["[\\/*]",   "comment" ]
    ],  

    "string": [
      ["[^\\\\\"]+",  "string"],
      ["@escapes", "string.escape"],
      ["\\\\.",      "string.escape.invalid"],
      ["\"",        { "token": "string.quote", "bracket": "@close", "next": "@pop" } ]
    ],
    
    "litstring": [
      ["[^\"]+",    "string"],
      ["\"\"",       "string.escape"],
      ["\"",        { "token": "string.quote", "bracket": "@close", "next": "@pop" } ]
    ],

    "whitespace": [
      ["^[ \\t\\v\\f]*#\\w.*$", "namespace.cpp" ],
      ["[ \\t\\v\\f\\r\\n]+", "white"],
      ["\\/\\*",       "comment", "@comment" ],
      ["\\/\\/.*$",    "comment"]
    ]
  }
}